#ifndef SELF_DEFINE_FUNCTIONS_H_INCLUDED
#define SELF_DEFINE_FUNCTIONS_H_INCLUDED


#include "./CEC2010/Header.h"
#include <math.h>
#include <boost/random.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/cauchy_distribution.hpp>
#include <boost/random/normal_distribution.hpp>
#include <boost/random/uniform_real.hpp>



const int timesOfRun = 30; // the number of independent runs
const int dim = 1000;//the dimension size of the problems




const int rand_group_set[] = {1,10,20,50,100,250};   //the group number pool
const int rand_group_size = 6;

const int Population_size = 500;//the population size
const int MAX_FV= 5e6;// the maximum number of fitness evaluations

const int record_FV_set[] = { 500000,1000000,1500000,2000000,2500000,3000000,3500000,4000000,4500000,5000000}; // record results when the number of fitness evaluations is greater than the elements in the set
const int record_set_size = 10;

const double phi = 0.1;//the control parameter PHI


Benchmarks* generateFuncObj(int funcID);

void Fitness( double &results, double *particle,  int &FV, Benchmarks* fp );

void Fitness_Computation( double *results, double **population, int &gbest, int num, int dim, int &FV, Benchmarks* fp );

void Random_Diff_Number( int *base, int base_num, int NP, int *selected_num, int num );

void Weighted_Global_Mean_Position( double **population, double * population_result, double *global_mean_position, int pop_size, int dim );

void Update_Base_Set( double *result, int *winner, int winner_size, int *loser, int loser_size, int *base_set, int &base_size );

int Select_Group_Size ( double* group_prob, int num );

void Compute_Probablity( double *record, double *prob, int num );

double Compute_Relative_Performance( double pre_result, double current_result );


#endif // SELF_DEFINE_FUNCTIONS_H_INCLUDED
